var UserModel = Class.extend({
	_users : null,
	_user : null,
	_userService : null,

	get : function(successcb, errorcb) {
		return this._userService.get(successcb, errorcb).then(function(data) {
			this._users = data;
		}.bind(this));
	},

	getById : function(userId, successcb, errorcb) {
		return this._userService.getById(userId, successcb, errorcb).then(
				function(data) {
					this._user = data;
				}.bind(this))
	},

	save : function(user, successcb, errorcb) {
		return this._userService.save(user, successcb, errorcb).then(
				function(data) {
				});
	},

	update : function(user, successcb, errorcb) {
		return this._userService.update(user, successcb, errorcb).then(
				function(data) {
				});
	},

	remove : function(username, successcb, errorcb) {
		return this._userService.remove(username, successcb, errorcb).then(
				function() {
				}.bind(this));
	},

	resetPassword : function(resetInfo, successcb, errorcb) {
		return this._userService.resetPassword(resetInfo, successcb, errorcb)
				.then(function() {
				}.bind(this));

	}

});

(function() {
	var UserModelProvider = Class.extend({
		instance : new UserModel(),

		$get : [ 'UserService', function(UserService) {
			this.instance._userService = UserService;
			return this.instance;
		} ]
	})

	angular.module('system.UserModel', []).provider('UserModel',
			UserModelProvider);
}());
